<?php

use think\facade\Route;

// Route::get('member', function () {
//     return 'hello,member!';
// });
// 微信退款
// Route::get('member/user1/index', 'member.User/index2');
// // 结算佣金
// Route::get('member/order/commissionRule', 'member.OrderController/commissionRule');

Route::get('mini/getUserSession', 'mini.MiniUserController/getUserSession');
Route::get('mini/getHomeList', 'mini.ProductController/getHomeList');
Route::get('mini/getProductInfo', 'mini.ProductController/getProductInfo');
Route::get('mini/getSpecDetail', 'mini.ProductController/getSpecDetail');
Route::get('mini/getCateList', 'mini.ProductController/getCateList');
Route::get('mini/getProductById', 'mini.ProductController/getProductById');
Route::get('mini/getBannerList', 'mini.ProductController/getBannerList');

// Route::get('mini/getPreOrderInfo', 'mini.OrderController/getPreOrderInfo');

// 需要登录鉴权的路由
Route::group('mini', function () {
    // 上传文件
    // Route::post('common/uploadFile', 'CommonController/uploadFile2');
    /*系统会员相关*/
    // \app\middleware\UserOperLog::class
    Route::get('getUserInfo', 'mini.MiniUserController/getUserInfo');
    // 获取手机号
    Route::post('getUserPhone', 'mini.MiniUserController/getUserPhone');
    Route::post('setUserInfo', 'mini.MiniUserController/setUserInfo');


    // 加购
    Route::post('addCart', 'mini.ProductController/addCart');
    Route::get('getCartList', 'mini.ProductController/getCartList');
    Route::post('setCartNum', 'mini.ProductController/setCartNum');
    Route::post('delCart', 'mini.ProductController/delCart');


    // 地址
    Route::post('saveAddress', 'mini.AddressController/save');
    Route::get('getAddress', 'mini.AddressController/getList');
    Route::get('getAddressDetail/:id', 'mini.AddressController/detail');
    Route::post('delAddress/:id', 'mini.AddressController/del');
    Route::post('setAddress', 'mini.AddressController/setAddress');
    Route::get('getInfoByLoca', 'mini.AddressController/getInfoByLoca');

    // 预览订单
    Route::get('getPreOrderInfo', 'mini.OrderController/getPreOrderInfo');
    // 下单
    Route::post('createOrder', 'mini.OrderController/createOrder');
    Route::post('canelOrder', 'mini.OrderController/canelOrder');
    Route::get('getOrderList', 'mini.OrderController/getOrderList');
    Route::get('getOrderInfo', 'mini.OrderController/getOrderInfo');
    // 二次支付
    Route::get('orderPay', 'mini.OrderController/orderPay');
    // 查看物流
    Route::get('getLogistic', 'mini.OrderController/getLogistic');
    Route::post('confirmOrder', 'mini.OrderController/confirmOrder');
    // 海报
    Route::get('getPosterList', 'mini.PosterController/getPosterList');
    // 我的收益
    Route::get('myReward', 'mini.MiniUserController/myReward');
    // 我的物流
    Route::get('getExpress', 'mini.OrderController/getExpress');
    // 退款原因
    Route::get('refundResonList', 'mini.RefundController/refundResonList');
    Route::post('applyRefund', 'mini.RefundController/applyRefund');
    Route::get('getRefundInfo', 'mini.RefundController/getRefundInfo');
    Route::get('getRefundList', 'mini.RefundController/getRefundList');
    Route::get('refundDetail', 'mini.RefundController/refundDetail');
    Route::post('canelApply', 'mini.RefundController/canelApply');
    // 用户填写快递
    Route::post('userSubmitExpress', 'mini.RefundController/userSubmitExpress');
    Route::post('createApply', 'mini.ApplyController/createApply');

    // 提现金额配置
    Route::get('getApplyMoneyList', 'mini.ApplyController/getApplyMoneyList');
    Route::get('getApplyLogList', 'mini.ApplyController/getApplyLogList');

    Route::get('getFensList', 'mini.MiniUserController/getFensList');


    // 上传文件
    Route::post('common/avatarUploadFile', 'CommonController/miniAvatarUploadFile');
    Route::post('common/uploadFile', 'CommonController/miniUploadFile');
    // Route::post('delCart', 'mini.AddressController/delCart');
})->middleware([\app\middleware\MiniAuthCheck::class,]);
